package stuman.entity;

import java.io.Serializable;
import java.util.ArrayList;

public class Student implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private String firstName, lastName;
	private ArrayList<Semester> semesterContainer= new ArrayList<Semester>();
	private ArrayList<Subject> subjects = new ArrayList<Subject>();
	
	public Student(){}
	
	public Student(String f, String l){
		this.firstName = f;
		this.lastName = l;
	}
	
	public String getFullName(){
		return firstName + lastName;
	}
	
	public String getFirstName(){return firstName;}
	
	public String getLastName(){return lastName;}
	
	public void addSemester(Semester s){semesterContainer.add(s);}
	
	public ArrayList<Semester> getSemester(){
		return semesterContainer;
	}
	
	public void addSubject(Subject s){
		subjects.add(s);
	}
	
	public ArrayList<Subject> getSubjects(){
		return subjects;
	}
	
	public Subject getSubject(String subjectName){
		for (int i=0;i<subjects.size();i++){
			if (subjects.get(i).getName().equals(subjectName)){
				return subjects.get(i);
			}
		}
		return null;
	}
	
	public void deleteSubject(Subject subjectName){
		if (subjects.contains(subjectName)){
			subjects.remove(subjectName);
		}
	}

	
}
